//
//  searchCollectionCell.m
//  doubleEduStudents
//
//  Created by 盛洋 on 2021/2/3.
//  Copyright © 2021 shengYang. All rights reserved.
//

#import "searchCollectionCell.h"

@implementation searchCollectionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    APPViewBorderRadius(self.time_lab, 5, .5, [UIColor clearColor]);
    self.time_lab.font = self.status_btn.titleLabel.font = self.look_lab.font = self.like_lab.font = AutoLabFont3;
    self.name_lab.font = self.look_btn.titleLabel.font = AutoLabFont2;
}

-(void)setModel:(AliefuModel *)model{
    _model = model;
//    if (_model.status == 0) {
//        //未开始
//        [_status_btn setBackgroundImage:[UIImage imageNamed:@"aliefu_unstart"] forState:UIControlStateNormal];
//        [_status_btn setTitle:@"未开始" forState:UIControlStateNormal];
//        [self.look_btn setHidden:YES];
//    }else if (_model.status == 1){
//        //报名中
//        [_status_btn setBackgroundImage:[UIImage imageNamed:@"aliefu_ing"] forState:UIControlStateNormal];
//         [_status_btn setTitle:@"报名中" forState:UIControlStateNormal];
//        [self.look_btn setHidden:NO];
//    }else if (_model.status == 2){
//        //评奖中
//        [_status_btn setBackgroundImage:[UIImage imageNamed:@"aliefu_start"] forState:UIControlStateNormal];
//         [_status_btn setTitle:@"评奖中" forState:UIControlStateNormal];
//        [self.look_btn setHidden:YES];
//    }else if (_model.status == 3){
//        //已结束
//        [_status_btn setBackgroundImage:[UIImage imageNamed:@"aliefu_unstart"] forState:UIControlStateNormal];
//         [_status_btn setTitle:@"已结束" forState:UIControlStateNormal];
//        [self.look_btn setHidden:YES];
//    }
//    if (_model.startTime.length > 10) {
//        _model.startTime = [_model.startTime substringToIndex:10];
//    }else{
//        _model.startTime = _model.startTime;
//    }
//    if (_model.endTime.length > 10) {
//        _model.endTime = [_model.endTime substringToIndex:10];
//    }else{
//        _model.endTime = _model.endTime;
//    }
//    _time_lab.text = [NSString stringWithFormat:@"%@ —— %@",_model.startTime,_model.endTime];
    
    _look_lab.text = [NSString stringWithFormat:@"%ld",_model.lookPeople];
    _like_lab.text = [NSString stringWithFormat:@"%ld",_model.joinPeople];
    [_top_img sd_setImageWithURL:[NSURL URLWithString:_model.photo] placeholderImage:DefaultImg];
    _name_lab.text = [NSString stringWithFormat:@"%@",_model.name];
    _time_lab.text = [NSString stringWithFormat:@"%@",model.des];
    
}

@end
